package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Employee {
    private Long id;

    private String username;

    private String realname;

    private String password;

    private String tel;

    private boolean state;

    private String email;

    private Department dept;
    @JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //与DateFormat的不同,DateFormat用于接受回数据,用于传送数据
    private Date hireDate;

    private boolean admin;

    private List<Role> roles = new ArrayList<>();

}